const sql = require("../../config/config");

// 获取users
function getUsers() {
  return sql("select * from users");
}

// 添加users
function addUsers(arr) {
  return sql("insert into users value (NULL,?,?,?,?,?,?,now())", arr);
}

// 更新users
function updateUsers(arr) {
  return sql(
    "update users set username = ?,password = ?,nickname = ?,role = ?,utime = ?  where users_id = ?",
    arr
  );
}

// 删除users
function deleteUsers(arr) {
  return sql("delete from users  where users_id = ?", arr);
}

module.exports = {
  getUsers,
  addUsers,
  updateUsers,
  deleteUsers,
};
